const searchByKeyWord2 = (oldWord)=>{
  if(backupList.length!=0){
    MergeRecordData(backupList);
  }
  const _data = toRaw(curentRecordData.value);
  const existList = _data.filter(item=>item.result.includes(oldWord));
  backupList = [...existList];
  searchTotal.value = existList.length;
  if(existList.length!=0){
    //开始替换要进行字符串索引匹配
      const regex = new RegExp(oldWord, 'g');
      existList.map(item=>{
        const matchs = [...toRaw(item.result).matchAll(regex)];//获取单段所有匹配的索引值
        console.log(matchs);
        let index = 0;//从0索引前开始
        matchs.forEach(match=>{
          const startIndex = match.index;//匹配的开始索引
          let oldstart = 0;
          let oldLength = oldWord.length;
          const endIndex = startIndex + (oldLength-1);//匹配的结束索引
          for(let i=0;i<item.words.length;i++){
            let option =  item.words[i];
            const strlong = option.text.length;//原文本的字符长度
            if(startIndex<=index || startIndex-index<=strlong-1){
              // console.log('寻找开始索引',index,startIndex,endIndex);
              const repIndex = index>startIndex? endIndex-index :startIndex-index;
              const repnum =  strlong-repIndex <=oldLength? strlong-repIndex:oldLength;
              let arr =[]
              if(endIndex-startIndex+1 < strlong){
                arr = option.text.replace(regex,`<span class='search_word'>${oldWord.slice(oldstart,oldstart+repnum)}</span>`).split('');
                option.text = arr.join('');
              }else{
                arr = option.text.split('');
                arr.splice(repIndex,repnum,`<span class='search_word'>${oldWord.slice(oldstart,oldstart+repnum)}</span>`);
                option.text = arr.join('');
              }
                oldstart+=repnum;
                oldLength-=repnum;
                if(startIndex===endIndex || endIndex-index<=oldLength-1 || oldLength==0){
                  debugger;
                  break;
                }else{
                  index+=strlong;
                }
            }else if(endIndex>=index && endIndex-index <=oldLength-1){
              const repIndex = index>startIndex? endIndex-index :startIndex-index;
              const repnum =  strlong-repIndex <=oldLength? strlong-repIndex:oldLength-repIndex;
              let arr = option.text.split('');
              arr.splice(repIndex,repnum,`<span class='search_word'>${oldWord.slice(oldstart,repnum)}</span>`);
              option.text = arr.join('');
              debugger;
              break;
            }else{
              index+=strlong;//原本的索引改变 
            }
          }
        })
      })
      MergeRecordData(existList)
  }
}